package com.enqualcomm.kids.network.socket.response;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Yinzhiqun on 2016/8/4.
 */
public class OscardProductsResult  extends BasicResult{
    public List<Data> result;

    public static class Data{
        public String productname;//该系列的名称
        public String producturl;//该系列的封面图片url(目前没用到)
        public List<Product> productpay;//产品分类信息
    }

    public static class Product implements Parcelable {
        public String productpayid;//产品id，生成订单时使用
        public String productname;//产品名称
        public String productdec;//产品描述
        public String money;//单价
        public String producturl;//图片url
        public String productdownnum;//下载次数
        public String productsize;//图片总大小
        public String productpicnum;//图片数量
        public String iffree;//是否免费
        public String ifbuy;//是否已购买
        public String orderid;//订单id，如果已购买，则不为空

        public static final Creator<Product> CREATOR = new Creator<Product>() {

            @Override
            public Product createFromParcel(Parcel parcel) {
                Product product = new Product();
                product.productpayid = parcel.readString();
                product.productname = parcel.readString();
                product.productdec = parcel.readString();
                product.money = parcel.readString();
                product.producturl = parcel.readString();
                product.productdownnum = parcel.readString();
                product.productsize = parcel.readString();
                product.productpicnum = parcel.readString();
                product.iffree = parcel.readString();
                product.ifbuy = parcel.readString();
                product.orderid = parcel.readString();
                return product;
            }

            @Override
            public Product[] newArray(int i) {
                return new Product[0];
            }
        };

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeString(productpayid);
            parcel.writeString(productname);
            parcel.writeString(productdec);
            parcel.writeString(money);
            parcel.writeString(producturl);
            parcel.writeString(productdownnum);
            parcel.writeString(productsize);
            parcel.writeString(productpicnum);
            parcel.writeString(iffree);
            parcel.writeString(ifbuy);
            parcel.writeString(orderid);
        }
    }
}
